package brickBreaker;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.geom.Rectangle;

public class Brick {
	public static int brickWidth=20, brickHeight=15;
	public float x,y;
	public Color brickColor;
	Brick(int xpos, int ypos, Color colorMe){
		x=xpos; y=ypos; brickColor=colorMe;
	}
	void draw(Graphics g){
		g.setColor(brickColor);
		g.fill(new Rectangle(x,y,brickWidth,brickHeight));
		g.setColor(brickColor.darker());
		g.draw(new Rectangle(x,y,brickWidth,brickHeight));
	}
	public boolean doesCollide(float x2, float y2, float r){
		return ((Math.abs(x-x2)<r+brickWidth)&&(Math.abs(y-y2)<r+brickHeight));
	}
}
